package cn.vivi.seckill.service.impl;

import cn.vivi.seckill.mapper.GoodsMapper;
import cn.vivi.seckill.pojo.Goods;
import cn.vivi.seckill.service.GoodsService;
import cn.vivi.seckill.vo.GoodsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsServiceImpl implements GoodsService {

    @Autowired
    private GoodsMapper goodsMapper;

    @Override
    public List<GoodsVo> findGoodsVo() {
        return goodsMapper.findGoodsVo();
    }

    @Override
    public GoodsVo findGoodsVoByGoodsId(String id) {
        return goodsMapper.findGoodsVoByGoodsId(id);
    }

    /**
     * 查询商品
     * @return
     */
    @Override
    public Goods findGoods(String goodsId) {
        return goodsMapper.selectById(goodsId);
    }
}
